﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ThaireInvestmentWeb.WcfSerivce;

namespace ThaireInvestmentWeb.Models
{
    public class ManageEquityPrivilegeModel
    {
        public EquityHeader Header { get; set; }
        public EquityHeaderDTO HeaderDTO { get; set; }
        public IList<EquityPrivilege> Privileges { get; set; }

        public ManageEquityPrivilegeModel()
        {
            if (null == Header)
                Header = new EquityHeader();
            if (Privileges == null)
                Privileges = new List<EquityPrivilege>();
        }

        public static ManageEquityPrivilegeModel BuildModel(EquityHeaderDTO data)
        {
            var model = new ManageEquityPrivilegeModel { Header = data.Header, HeaderDTO = data };
            if (data.Privileges != null)
                model.Privileges = data.Privileges;

            return model;
        }
        public int HeaderID
        {
            get
            {
                return Header.EquityHeaderID;
            }

            set
            {
                Header.EquityHeaderID = value;
            }
        }
    }
}